/*
 * @Author: dyt
 * @Date: 2018-06-26 10:56:06
 * @Last Modified by: dyt
 * @Last Modified time: 2018-06-27 15:08:07
 */

import { getMode } from '@/utils/api'
export const mixinsMode = {
  data () {
    return {
      mode: null
    }
  },
  methods: {
    async getMode () {
      try {
        wx.showLoading({ title: '加载中...' })
        let res = await getMode()
        this.mode = res.auditMode
        wx.setNavigationBarTitle({
          title: res.smallRoutine
        })
        if (this.mode !== null) {
          wx.setStorageSync('mode', this.mode)
          wx.setStorageSync('title', res.smallRoutine)
        }
        wx.hideLoading()
      } catch (e) {
        console.log(e)
      }
    }
  }
}
